<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link href="../css/bootstrap-theme.min.css" rel="stylesheet"
	type="text/css" />
<link href="../css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/ckeditor.js"></script>
</head>
<body>
	<%
		String uri = request.getScheme() + "://" + // "http" + "://
				request.getServerName() + // "myhost"
				":" + // ":"
				request.getServerPort() + // "8080"
				request.getRequestURI() + // "/people"
				"?" + // "?"
				request.getQueryString(); // "lastname=Fox&age=30"
				
				String post_id = request.getParameter("postid");
	%>
	<div>dfkjasdkf Kiên ĐÙ nên bị ĐÙ</div>
	
	<input type="hidden" value="<%=post_id%>" id="postid" />

	<form id="add_comment">
		<img
			src="//lh6.googleusercontent.com/-2mKbt6cdqMQ/AAAAAAAAAAI/AAAAAAAAAAA/CAtgUhD0Dbg/s28-c-k-no/photo.jpg"
			width="28px" height="28px" alt="" class="go wi Wh SC"/>
			<div class="Pf">
		<textarea rows="4" cols="50" id="comment"></textarea>
		</div>
		
		
	</form>
	<button value="comment" id="add_cm_btn" class="btn btn-primary">dfasdfa</button>

	<div slyle="width: 1000px; margin: 0 auto; background: blue;">
		<div id="fb-root"></div>
		<script>
		
			(function(d, s, id) {
				var js, fjs = d.getElementsByTagName(s)[0];
				if (d.getElementById(id))
					return;
				js = d.createElement(s);
				js.id = id;
				js.src = "//connect.facebook.net/vi_VN/sdk.js#xfbml=1&version=v2.0";
				fjs.parentNode.insertBefore(js, fjs);
			}(document, 'script', 'facebook-jssdk'));
		</script>

		<div class="fb-share-button" data-href="<%=uri%>"></div>
	</div>
	<script>
	$(document).ready(function(){
		$("#add_cm_btn").click(function(){
			alert("vao day");
			var data = {"comment": $("#comment").val()};
			console.log(data);
			 $.ajax({
	        		type:"POST",
	        		url : "/Travelholic/add_comment?postid="+$("#postid").val(),
	        		dataType: "json",
	        		data : data,
	        		success : function(){
	       			},
	       			error: function(){
	       				console.log("comment");
	    			}
		});
		return false;
		});
	});
	</script>
</body>
</html>